package com.example.design.proxy.staticstate;

/**
 * 静态代理
 */
public class TeacherProxy implements ITeacher{
    /**
     * 目标对象，聚合
     */
    private MathTeacher target;

    public TeacherProxy(MathTeacher target) {
        this.target = target;
    }

    @Override
    public void teach() {
        System.out.println("静态代理开始前的方法");
        target.teach();
        System.out.println("静态代理开始后的方法");
    }
}
